import React from 'react';
import '../../../css/maintenan/addDevicel.less'; // 引入CSS样式文件
import { Tabs } from "antd";
import type { TabsProps } from 'antd';

import AddDevice from './addcomponent/index';
import Rusult from './addcomponent/rusult';
import { useLocation } from 'react-router-dom';


const RepairForm: React.FC = () => {
    const id = useLocation().state;
    const items: TabsProps['items'] = [
        {
            key: '1',
            label: '发起维修',
            children: <div>
                <AddDevice></AddDevice>
            </div>,
        },
        {
            key: '2',
            label: '上传维修结果',
            children:
                <div>
                    <Rusult Id={id}></Rusult>
                </div>,
        },
    ];


    const onChange = (key: string) => {
        console.log(key);
    };
    return (
        <>
            <Tabs defaultActiveKey="1" items={items} onChange={onChange} />
        </>
    );
};


export default RepairForm;